package org.parngon.maze;

import org.parngon.common.Coord;

public class DeadendPair<T extends Coord> implements FlashSortable
{
  Tile<T> start;
  Tile<T> end;
  double distance = 0;

  public DeadendPair(Tile<T> s, Tile<T> e)
  {
    start = s;
    end = e;

    //distance = Math.sqrt((s.x - e.x) * (s.x - e.x) + (s.y - e.y) * (s.y - e.y));
    distance = s.getLocation().distance(e.getLocation());
  }

  public int sortOrder()
  {
    return (int)(distance * 1000);
  }

  public Tile<T> getStart()
  {
    return start;
  }

  public Tile<T> getEnd()
  {
    return end;
  }

  public double getDistance()
  {
    return distance;
  }
}
